#pragma once

#include "resource.h"

class CWndResizer;

class CRequestDumperWnd : public CDialogImpl<CRequestDumperWnd>
{

	public:
	
// Dialog Data
		enum { IDD = IDD_REQUEST_DUMPER };
		
		typedef CDialogImpl<CRequestDumperWnd> baseClass;
		
		//DECLARE_FRAME_WND_CLASS_EX(_T("PortalBrowserFrame"), 0, 0, COLOR_3DFACE);
		
		BEGIN_MSG_MAP(CRequestDumperWnd)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_SIZE, OnSize)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		COMMAND_HANDLER(IDOK, 0, OnBtnOK)
		COMMAND_HANDLER(IDC_BTN_COPY, 0, OnCopy)
		/*
		MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
		MESSAGE_HANDLER(WM_NCDESTROY, OnNcDestroy)
		MESSAGE_HANDLER(WM_COMMAND, OnCommand)
		*/
		//CHAIN_MSG_MAP(baseClass)
		END_MSG_MAP()
		
		CRequestDumperWnd(HWND hCallbackWnd);
		~CRequestDumperWnd();
		
		LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
		LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
		LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
		LRESULT OnCopy(WORD /* wNotifyCode */, WORD wID, HWND /* hWndCtl */, BOOL& /* bHandled */);
		LRESULT OnBtnOK(WORD /* wNotifyCode */, WORD wID, HWND /* hWndCtl */, BOOL& /* bHandled */);
		
		void AddRequest(LPCWSTR pwcURL, LPCWSTR pwcHeaders, LPCWSTR pwcPOSTData);
		
	protected:
		CWndResizer *m_pResizer;
		CListViewCtrl m_List;
		
		HWND m_hCallbackWnd;
		
};

enum DefinedMessages {WM_CLOSE_REQUEST = WM_USER + 1};